/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLJAVA_CONST_TYPES_DOUBLE_H
#define PLJAVA_CONST_TYPES_DOUBLE_H

#include <PLJavaFile.h>

namespace PLSDK {

/**
 * Class represent a double value in the const table.
 */
class PLJavaConstTypesDouble : public PLJavaConst {
public:
    /**
     * Constructor.
     *
     * @param high The high bytes.
     * @param low The low bytes.
     */
    PLJavaConstTypesDouble(u4 high, u4 low);
    /**
     * Get the value of the double.
     *
     * @return The double.
     */
    inline double doubleValue();
    /**
     * Get the negative infinity value.
     *
     * @return True if it was a negative infinity.
     */
    inline bool negInfinity();
    /**
     * Get the positive infinity value.
     *
     * @return True if it was a positive infinity.
     */
    inline bool posInfinity();
    /**
     * Get the not a number value.
     *
     * @return True if it was not a number.
     */
    inline bool nan();
private:
    bool m_nan;
    bool m_negInfinity;
    bool m_posInfinity;
    double m_value;
};

double PLJavaConstTypesDouble::doubleValue() {
    return m_value;
}

bool PLJavaConstTypesDouble::negInfinity() {
    return m_negInfinity;
}

bool PLJavaConstTypesDouble::posInfinity() {
    return m_posInfinity;
}

bool PLJavaConstTypesDouble::nan() {
    return m_nan;
}

}

#endif
